/**
 * Created by IntelliJ IDEA.
 * User: Bezdelnick
 * Date: 9/26/12
 * Time: 8:07 PM
 * To change this template use File | Settings | File Templates.
 */
package vplib.component {

import alternativa.engine3d.objects.Mesh;

import vplib.dictionary.PropertiesDictionary;
import vplib.dictionary.SurfacesDictionary;

import vplib.model.AbstractPropertyModel;

public class AbstractPhysicsComponent {
    protected var _uniqueId:String;
    protected var _surface:Mesh;
    protected var _model:AbstractPropertyModel;

    /**
     * @description
     *      Abstract Physics Component composed with surface and math-model.
     *      You must specify unique id for component
     *
     * @param uniqueId - unique identifier for searching necessary component
     */
    public function AbstractPhysicsComponent(uniqueId:String) {
        _uniqueId = uniqueId;
    }

    /*public virtual function copy(apc:AbstractPhysicsComponent):void {
        trace("[AbstractPhysicsComponent] \t- copy - Create copy with component: { name: " + apc.getComponentName() + "}");
    }*/
    
    /*public function copy(apc:AbstractPhysicsComponent):void {
        this._uniqueId = apc.uniqueId;
        this._surface = SurfacesDictionary.getSurface(apc.getComponentName());
        this._model = apc.model;
    }*/

    /*public function applyModel():void {

        try {
            _surface.x = Number(_model.getPropertyByName(PropertiesDictionary.get_COORDINATE_X().name).value);
            _surface.y = Number(_model.getPropertyByName(PropertiesDictionary.get_COORDINATE_Y().name).value);
            _surface.z = Number(_model.getPropertyByName(PropertiesDictionary.get_COORDINATE_Z().name).value);
            trace("[AbstractPhysicsComponent] \t- applyModel() - apply coordinate");
        } catch (error:Error) {
            trace(error.message);
        }

        try {
            _surface.scaleX = Number(_model.getPropertyByName(PropertiesDictionary.get_SCALE_X().name).value);
            _surface.scaleY = Number(_model.getPropertyByName(PropertiesDictionary.get_SCALE_Y().name).value);
            _surface.scaleZ = Number(_model.getPropertyByName(PropertiesDictionary.get_SCALE_Z().name).value);
            trace("[AbstractPhysicsComponent] \t- applyModel() - apply scale");
        } catch (error:Error) {
            trace(error.message);
        }
    }*/

    public function getUniqueId():String {
        return this._uniqueId;
    }

    public function setUniqueId(id:String):void {
        this._uniqueId = id;
    }

    public function getSurface():Mesh {
        return this._surface;
    }

    public function setSurface(mesh:Mesh):void {
        this._surface = mesh;
    }

    public function getModel():AbstractPropertyModel {
        return this._model;
    }
    public function setModel(model:AbstractPropertyModel):void {
        this._model = model;
    }
}
}
